<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="../../../commons/taglib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>药品检测</title>
	<link rel="stylesheet" href="${ctx}/static/css/pintuer.css">
    <link rel="stylesheet" href="${ctx}/static/css/admin.css">
    <script src="${ctx}/static/js/jquery.js"></script>
    <script src="${ctx}/static/js/pintuer.js"></script> 
</head>
<body>
<form method="post" action="excel"  >
	<div class="panel admin-panel">
		<div class="panel-head">
			<!-- <strong class="icon-reorder"> 挂号管理</strong> -->
			<select style="padding:5px 15px; border:1px solid #ddd;" onchange="change(this.value)">
            <option value="detection" selected="selected">药房药品综合查询</option>
            <option value="detection" selected="selected">药房药品销售查询</option>
            <option value="detection" selected="selected">药房药品汇总统计</option>
            <option value="detection" selected="selected">药房药品调价汇总</option>
            <option value="detection" selected="selected">药房供货单位汇总</option>
            <option value="detection" selected="selected">药房供货单位统计</option>
            <option value="detection" selected="selected">药房领药单据统计</option>
            <option value="detection" selected="selected">门诊药房发药统计</option>
          	</select>
			<div style="float: right;">
				<button class="button border-main excel" type="submit"> 导出Excel</button>
			    <a class="button border-main" href="drugadmin"> 刷新</a>
			</div>
			<div style="clear: both;"></div>
		</div>
		
			<label class="checkbox" style="margin-left: 20px">药品类型: </label>
			<label class="checkbox"><input  type="radio" id="yplb" name="yplb" value="西药" checked="checked">西药 </label>
 
			<label class="checkbox"><input  type="radio" id="yplb" name="yplb" value="中药" checked="checked">中药 </label>
 
			<label class="checkbox"><input  type="radio" id="yplb" name="yplb" value="中草药" checked="checked">中草药 </label>
 
			<label class="checkbox"><input  type="radio" id="yplb" name="yplb" value="材料" checked="checked">材料 </label>

		<div class="padding border-bottom">
		
			<ul class="search" style="padding-left:10px;">
				<li>
				<select style="padding:5px 15px; border:1px solid #ddd;" onchange="change(this.value)">
            		<option value="detection" selected="selected">入库汇总</option>
            		<option value="detection" selected="selected">出库汇总</option>
            		<option value="detection" selected="selected">盈缺汇总</option>
            		<option value="detection" selected="selected">调拨汇总</option>
            		<option value="detection" selected="selected">报损汇总</option>
            		<option value="detection" selected="selected">退货汇总</option>
            		<option value="detection" selected="selected">退药汇总</option>     
          		</select>
          
				</li>
				<li>
					<input  class="input" name="ID_search" value="" placeholder="请输入药品名称(ID)" id="ID_search" required ="required"/>
				</li>
				<li>
					<input type="date" class="input" name="sc_date" value="2015-03-20" id="sc_date" required ="required"/>
				</li><li>
					<input type="date" class="input" name="yx_date" value="2017-03-20" id="yx_date" required ="required"/>
				</li>
				<li>
				<script type="text/javascript">
				//药品 生产日期 过期日期模糊查询
				function sj_Date_search(){
					var obj=document.getElementsByName('yplb'); 
					var yao_name='';    
					for(var i=0; i<obj.length; i++){    
					   if(obj[i].checked) yao_name+=obj[i].value+','; 
					}
					console.log(yao_name);
					var name=document.getElementById('ID_search').value;
					var sc_date=document.getElementById('sc_date').value;
					var yx_date=document.getElementById('yx_date').value;
					location ="yp_typesum_search?"+"name="+name+"&sc_date="+sc_date+"&yx_date="+yx_date+"&yao_name="+yao_name ;
					
				}
				</script>
				<a class="button border-main" href="JavaScript:;" onclick="sj_Date_search()"> 查询</a>
					<a class="button border-main" href="JavaScript:;" href="yp_typesum">清除查询</a>	
				</li>
			</ul>
		</div>
		<table class="table table-hover text-center">
		<tr>
			<th>药品ID</th>
			<th>药品名称</th>
			<th>药品类型</th>
			<th>规格</th>
			<th>单位</th>
			<th>产地</th>
			<th>数量</th>
			<th>零售金额</th>
			<th>进货总额</th>
			<th>生产日期</th>
			<th>过期日期</th>
		</tr>
		<c:forEach items="${yp_typesum}" var="list">
			<tr>
				<td style="text-align:left; padding-left:20px;border-bottom: 1px solid #ddd;"><input type="hidden" name="id" value="${list.id }" /> ${list.id }</td>
				<td style="border-bottom: 1px solid #ddd;"><input type="hidden" name="category" value="${list.name }"/>${list.name }</td>
				<td style="border-bottom: 1px solid #ddd;"><input type="hidden" name="category" value="${list.yao_name }"/>${list.yao_name }</td>
				<td style="border-bottom: 1px solid #ddd;"><input type="hidden" name="name" value="${list.spec }"/>${list.spec }</td>
				<td style="border-bottom: 1px solid #ddd;"><input type="hidden" name="do_name" value="${list.unit }"/>${list.unit}</td>
				<td style="border-bottom: 1px solid #ddd;"><input type="hidden" name="sex" value="${list.region }"/>${list.region }</td>
				<td style="border-bottom: 1px solid #ddd;"><input type="hidden" name="fee" value="${list.stock}"/>${list.stock}</td>
				<td style="border-bottom: 1px solid #ddd;"><input type="hidden" name="deal" value="${list.price }"/>${list.price }</td>
				<td style="border-bottom: 1px solid #ddd;"><input type="hidden" name="deal" value="${list.p_price }"/>${list.p_price }</td>
				<td style="border-bottom: 1px solid #ddd;"><input type="hidden" name="deal" value="${list.sc_date }"/>${list.sc_date }</td>
				<td style="border-bottom: 1px solid #ddd;"><input type="hidden" name="deal" value="${list.sh_date}"/>${list.sh_date }</td>
			</tr>
		</c:forEach>
		<c:if test="${ pageNumber!=null }">
			<tr>
				<td colspan="7">
					<div class="pagelist">
						<a href="detection?pageNumber=1">首页</a>
						<%-- <%if(){} %> --%>
						<c:if test="${ 1 != pageNumber && pageNumber >0 }">
							<a href="inventory?pageNumber=${pageNumber-1 }">上一页</a>
						</c:if>
						
						<c:if test="${ 0 != pageNumber-1 && 1 != pageNumber-1 && pageNumber >0 }">
							...
						</c:if>
						
						<c:if test="${ 1 != pageNumber && pageNumber >0 }">
							<a href="inventory?pageNumber=${pageNumber-1 }">${pageNumber-1 }</a>
						</c:if>
						
						<a href="inventory?pageNumber=${pageNumber }">${pageNumber }</a>
						
						<c:if test="${ Pages != pageNumber && pageNumber >0 }">
							<a href="inventory?pageNumber=${pageNumber+1 }">${pageNumber+1 }</a>
						</c:if>
						
						<c:if test="${ Pages != pageNumber && Pages != pageNumber+1 && pageNumber >0 }">
							...
						</c:if>
						
						<c:if test="${Pages != pageNumber && pageNumber >0 }">
							<a href="inventory?pageNumber=${pageNumber+1 }">下一页</a>
						</c:if>
						
						<a href="inventory?pageNumber=${Pages }">尾页</a>
						第${pageNumber }页/共${Pages }页
					</div>
				</td>
			</tr>
		</c:if>
		</table>
	</div>
</form>

</body>
<script type="text/javascript">
function change(data){
	window.location=data;
};
</script>
</html>